﻿function lightbox(element, prod) {
    var outerDiv = document.createElement('div');
    var innerDiv = document.createElement('div');
    var btnFechar = document.createElement('div');

    outerDiv.className = 'outer';
    innerDiv.className = 'inner';
    btnFechar.className = 'btnFechar';


    if (prod == "portas") {
        innerDiv.style.backgroundImage = "url('../../Imagens/Portas2/" + element + "')";
    } else if (prod == "janelas") {
        innerDiv.style.backgroundImage = "url('../../Imagens/Janelas2/" + element + "')";
    } else if (prod == "armarios") {
        innerDiv.style.backgroundImage = "url('../../Imagens/Armarios2/" + element + "')";
    }


    innerDiv.style.backgroundSize = "100%";

    btnFechar.addEventListener("click", function () {
        outerDiv.remove();
    });

    outerDiv.addEventListener("click", function () {
        outerDiv.remove();
    });


    innerDiv.appendChild(btnFechar);
    outerDiv.appendChild(innerDiv);
    document.body.appendChild(outerDiv);
}
